<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/TravelAgents.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
      :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields"
      :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from '@/extension/mall/TravelAgents.js';
import ViewGrid from '@/components/basic/ViewGrid.vue';
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '旅行社列表',
        name: 'TravelAgents',
        url: '/TravelAgents/',
        sortName: 'createDate',
      },
      extend: extend,
      editFormFields: {
        accountsId: '',
        distributorType: '',
        distributorCode: '',
        epidemicReminder: '',
        productType: '',
        distributorName: '',
        isMessage: '',
        smsMode: '',
        smsId: '',
        signCode: '',
        contactPerson: '',
        contactPhone: '',
        timeContainer: [],
        distributorStartTime: '',
        distributorEndTime: '',
        isAvailable: '1',
        creator: '',
        createID: '',
        createDate: '',
        modifier: '',
        modifyID: '',
        modifyDate: '',
        merchantCode: '',
        merchantName: '',
        travelAgentsPerson: '',
        shareImg: '',
        directdistriCode: '',
      },
      editFormOptions: [
        [
          {
            dataKey: '',
            data: [],
            title: '分销商类型',
            field: 'distributorType',
            type: 'select',
            required: true,
          },
          {
            title: '挂账单位',
            field: 'accountsId',
            required: true,
            type: 'select',
            hidden: true,
          },
        ],
        [
          {
            title: '分销商名称',
            field: 'distributorName',
            type: 'text',
            hidden: true,
          },
          {
            title: '分销商编码',
            field: 'distributorCode',
            type: 'text',
            hidden: true,
          },
        ],
        [
          {
            dataKey: 'type_p',
            data: [],
            title: '产品类型',
            field: 'productType',
            type: 'selectList',
            hidden: true,
            colSize: 6,
          },
          {
            title: '起止时间',
            required: true,
            field: 'timeContainer',
            colSize: 6,
            type: 'datetime',
            range: true,
            hidden: true,
          },
        ],
        [
          {
            title: '疫情提示',
            field: 'epidemicReminder',
            type: 'textarea',
            hidden: true,
            colSize: 12,
          },
        ],
        [
          {
            title: '是否发送短信',
            field: 'isMessage',
            type: 'switch',
            hidden: true,
          },
          {
            dataKey: 'sms_mode',
            data: [],
            title: '短信模式',
            field: 'smsMode',
            type: 'select',
            hidden: true,
          },
        ],
        [
          {
            dataKey: 'Signs',
            data: [],
            title: '短信签名',
            field: 'signCode',
            type: 'select',
            hidden: true,
          },
          {
            dataKey: 'Messages',
            data: [],
            title: '短信模板',
            field: 'smsId',
            type: 'select',
            hidden: true,
          },
        ],
        [
          {
            title: '模板内容',
            field: 'spare10',
            type: 'text',
            hidden: false,
            disabled: true,
            colSize: 12,
          },
        ],
        [
          {
            title: '联系人',
            field: 'contactPerson',
            type: 'text',
            hidden: true,
          },
          {
            title: '联系人电话',
            field: 'contactPhone',
            type: 'text',
            required: false,
            hidden: true,
          },
        ],

        [
          {
            title: '旅行社操作员',
            field: 'travelAgentsPerson',
            type: 'text',
            hidden: true,
          },
          {
            title: '关联直营',
            field: 'directdistriCode',
            type: 'select',
            // required: true,
            data: [],
            dataKey: '',
            extra: {
              tooltip: true,
              content: "产品佣金模式关联的小程序"
            }
          }
        ],

        //   [{"title":"开始时间","field":"distributorStartTime","type":"datetime","hidden":true},
        //    {"title":"结束时间","field":"distributorEndTime","type":"datetime","hidden":true},],
        [
          {
            title: '创建人',
            field: 'creator',
            disabled: true,
            type: 'text',
            hidden: true,
          },
          {
            title: '创建时间',
            field: 'createDate',
            disabled: true,
            type: 'datetime',
            hidden: true,
          },
        ],
        [
          {
            title: '修改人',
            field: 'modifier',
            disabled: true,
            type: 'text',
            hidden: true,
          },
          {
            title: '修改时间',
            field: 'modifyDate',
            disabled: true,
            type: 'datetime',
            hidden: true,
          },
        ],
      ],
      searchFormFields: {
        distributorType: '',
        distributorName: '',
        contactPerson: '',
        contactPhone: '',
        createDate: '',
      },
      searchFormOptions: [
        [
          { title: '分销商名称', field: 'distributorName', type: 'like' },
          {
            dataKey: 'distributor_Type',
            data: [],
            title: '分销商类型',
            field: 'distributorType',
            type: 'select',
          },
          { title: '联系人', field: 'contactPerson', type: 'like' },
          { title: '联系人电话', field: 'contactPhone', type: 'like' },
        ],
        [{ title: '创建时间', field: 'createDate', type: 'datetime' }],
      ],
      columns: [
        {
          field: 'distributorType',
          title: '分销商类型',
          type: 'int',
          bind: { key: 'distributor_Type', data: [] },
          width: 120,
          align: 'left',
          sortable: true,
        },
        {
          field: 'distributorCode',
          title: '分销商编码',
          type: 'string',
          width: 220,
          align: 'left',
          hidden: true,
        },
        {
          field: 'distributorName',
          title: '分销商名称',
          type: 'int',
          bind: { key: '', data: [] },
          width: 220,
          align: 'left',
        },
        {
          field: 'productType',
          title: '产品类型',
          type: 'string',
          bind: { key: 'type_p', data: [] },
          width: 120,
          align: 'left',
        },
        {
          field: 'isMessage',
          title: '是否发送短信',
          type: 'sbyte',
          bind: { key: 'enable', data: [] },
          width: 120,
          align: 'left',
        },
        {
          field: 'smsName',
          title: '短信模板编码',
          type: 'string',
          bind: { key: 'Messages', data: [] },
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'smsId',
          title: '短信模板名称',
          type: 'int',
          bind: { key: 'Messages', data: [] },
          width: 150,
          align: 'left',
        },
        {
          field: 'smsModeName',
          title: '短信模式',
          type: 'string',
          bind: { key: 'sms_mode', data: [] },
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'smsMode',
          title: '短信模式',
          type: 'int',
          bind: { key: 'sms_mode', data: [] },
          width: 150,
          align: 'left',
        },
        {
          field: 'signName',
          title: '短信签名编码',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'signCode',
          title: '短信签名名称',
          type: 'int',
          bind: { key: 'Signs', data: [] },
          width: 180,
          align: 'left',
        },
        {
          field: 'contactPerson',
          title: '联系人',
          type: 'string',
          width: 120,
          align: 'left',
        },
        {
          field: 'contactPhone',
          title: '联系人电话',
          type: 'string',
          width: 150,
          align: 'left',
        },
        {
          field: 'distributorStartTime',
          title: '合约开始时间',
          type: 'datetime',
          width: 220,
          align: 'left',
          sortable: true,
        },
        {
          field: 'distributorEndTime',
          title: '合约结束时间',
          type: 'datetime',
          width: 220,
          align: 'left',
          sortable: true,
        },
        {
          field: 'isAvailable',
          title: '是否可用',
          type: 'sbyte',
          hidden: true,
          width: 120,
          align: 'left',
        },
        {
          field: 'creator',
          title: '创建人',
          type: 'string',
          width: 120,
          readonly: true,
          align: 'left',
        },
        {
          field: 'createDate',
          title: '创建时间',
          type: 'datetime',
          width: 220,
          readonly: true,
          align: 'left',
          sortable: true,
        },
        {
          field: 'modifier',
          title: '修改人',
          type: 'string',
          width: 120,
          readonly: true,
          align: 'left',
        },
        {
          field: 'modifyDate',
          title: '修改时间',
          type: 'datetime',
          width: 220,
          readonly: true,
          align: 'left',
          sortable: true,
        },
        {
          field: 'accountsId',
          title: '应收账户',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare2',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        //   { field: 'spare15', title: '分销商封面图', type: 'string', width: 120, hidden: true, align: 'left' },
        {
          field: 'spare14',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare13',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare12',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare11',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare10',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'roleId',
          title: '弃用',
          type: 'int',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'modifyID',
          title: '修改人ID',
          type: 'int',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'createID',
          title: '创建人ID',
          type: 'int',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare8',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'id',
          title: '主键',
          type: 'string',
          width: 120,
          hidden: true,
          readonly: true,
          require: true,
          align: 'left',
        },
        {
          field: 'isDelete',
          title: '是否删除',
          type: 'int',
          width: 120,
          hidden: true,
          require: true,
          align: 'left',
        },
        {
          field: 'spare9',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
      ],
      detail: {
        cnName: '#detailCnName',
        columns: [],
        sortName: '',
        key: '',
      },
    };
  },
};
export default vueParam;
</script>
